﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Interfaz_V1
{
    public partial class prompt : Form
    {

        public String value;
        public prompt()
        {
            InitializeComponent();
        }

        public prompt(String title, String message, int min, int max)
        {
            InitializeComponent();
            this.Text = title;
            labelMsg.Text = message;
            numericValue.Minimum = min;
            numericValue.Maximum = max;
            value = "";
        }

        private void prompt_Load(object sender, EventArgs e)
        {

        }

        private void buttonAccept_Click(object sender, EventArgs e)
        {
            value = numericValue.Value.ToString();
            this.Close();
        }

        private void buttonCancel_Click(object sender, EventArgs e)
        {
            value = "";
            this.Close();
        }

        private void textBoxValue_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
                buttonAccept_Click(sender, e);
        }
    }
}
